package com.boot2523.myredis.r3;

import redis.clients.jedis.Jedis;

import java.util.HashMap;

public class R3 {
    public static void main(String[] args) {
        //将多个人的成绩存入redis中
        Jedis j=new Jedis("localhost",6379);
        HashMap<String,Double> data=new HashMap<>();
        data.put("tom",Double.valueOf(80));
        data.put("mary",Double.valueOf(70));
        data.put("jack",Double.valueOf(99));
        j.zadd("hotscore",data);
        System.out.println(j.zscore("hotscore","tom"));
        System.out.println(j.zscore("hotscore","mary"));
        System.out.println(j.zscore("hotscore","jack"));
        System.out.println(j.zrange("hotscore",0,-1));
        System.out.println(j.zrangeWithScores("hotscore",0,-1));
    }
}
